package com.api.shopapi.mapper;

import com.api.shopapi.entity.ActivityOrderRecord;
import com.api.shopapi.entity.ActivityOrderRecordImg;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
@Mapper
public interface ActivityOrderRecordImgMapper {


    @Insert("insert into activity_order_record_img " +
            "(" +
            "ActivityOrderRecordImgCode," +
            "ActivityOrderRecordCode," +
            "ImgPath," +
            "Sort" +
            ") " +
            "values " +
            "(" +
            "#{activityOrderRecordImg.ActivityOrderRecordImgCode}," +
            "#{activityOrderRecordImg.ActivityOrderRecordCode}," +
            "#{activityOrderRecordImg.ImgPath}," +
            "#{activityOrderRecordImg.Sort}" +
            ")" )
    int insert(@Param("activityOrderRecordImg") ActivityOrderRecordImg activityOrderRecordImg);


    @Select("select * from activity_order_record_img where activityOrderRecordCode=#{activityOrderRecordCode} order by sort desc")
    List<ActivityOrderRecordImg> ListByActivityOrderRecordCode(@Param("activityOrderRecordCode") String activityOrderRecordCode);


}
